// DBWork.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>

#include "Version.h"

const char CompareCode[]  = "-CompareCode";
char* getArg(_TCHAR* argv[], int nArg)
{
#ifdef _UNICODE
    return = (char*)_alloca(_tcslen(argv[nArg]);   
#else
    return (char*)argv[nArg];
#endif

}

int _tmain(int argc, _TCHAR* argv[])
{
    char* arg = getArg (argv, 1);
    int retval = 0;

    if( argc <= 1 )
    {
        return 0;
    }
    if(0 == strcmp(arg, CompareCode))
    {
        Version vers1( getArg (argv, 2) );
        Version vers2( getArg (argv, 3) );
        if(vers1==vers2)
        {
            retval = 0;
        }
        else if(vers1>vers2)
        {
            retval = 1;
        }
        else
        {
            retval = -1;
        }

    }
    std::cout<<retval<<std::endl;
	return retval;
}

